/**
 * 
 */
package com.imooc.security.core.social.gitee.connet;

import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider;

import com.imooc.security.core.social.gitee.api.Gitee;
import com.imooc.security.core.social.gitee.api.GiteeImpl;
import com.imooc.security.core.social.qq.api.QQ;
import com.imooc.security.core.social.qq.api.QQImpl;

/**
 * @author zhailiang
 *
 */
public class GiteeServiceProvider extends AbstractOAuth2ServiceProvider<Gitee> {

	/**导向QQ*/
	private static final String URL_AUTHORIZE = "https://gitee.com/oauth/authorize";
	/**获取toKEN*/
	private static final String URL_ACCESS_TOKEN = "https://gitee.com/oauth/token";
	//1-5步
	public GiteeServiceProvider(String appId, String appSecret) {
		//相当app的用户名，和密码    
		super(new GiteeOAuth2Template(appId, appSecret, URL_AUTHORIZE, URL_ACCESS_TOKEN));
	}
	//第六步
	@Override
	public Gitee getApi(String accessToken) {
		return new GiteeImpl(accessToken);
	}

}
